package com.weiiew.imageservice.controller;

import com.weiiew.imageservice.service.ImageServiceImpl;
import com.weiiew.common.OnlyFeign.OnlyFeign;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Author 魏锴
 * @Date 2025/4/3
 */
@RestController
@RequestMapping("/image/feign")
@RequiredArgsConstructor
@OnlyFeign
public class ImageFeignController {
    private final ImageServiceImpl imageService;
    @RequestMapping("/remove")
    public boolean removeImage(@RequestParam("type") String type,
                               @RequestParam("version") String version,
                               @RequestParam("filename") String filename){
        return imageService.removeImage(type, version, filename);
    }
    @RequestMapping("/net/save")
    public boolean saveNetImage(@RequestParam("type") String type,
                                @RequestParam("version") String version,
                                @RequestParam("filename") String filename,
                                @RequestParam("url") String url){
        return imageService.saveNetImage(type, version, filename, url);
    }
}
